Applications, such as word processing or spreadsheet programs, operate on documents. Such software applications may allow users to perform data operations using customized code such as, for example, macros. The code may be embedded so that the application stores the code within the document. The code embedded in the document may be executed in connection with performing operations on the document when accessed by the application. Use of such code by the application presents a security risk including an opportunity for malicious code or a code modification to be introduced into the code portion of the document. Malicious code may be unknowingly executed by the application when accessing the document.
One approach used to ensure that there have been no modifications to the embedded code, such as through the introduction of malicious code into the document, is attaching a digital signature to the code portion. Existing applications which allow users to develop such code portions may also allow the users to digitally sign their code. While the document is opened and accessed by the application, the user may manually select one or more menu options in connection with forming the digital signature.